package com.demo.house.controller;


import com.demo.house.common.Result;
import com.demo.house.service.QuestionService;
import com.demo.house.service.UserService;
import com.demo.house.vo.request.RequestQuestionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/question/")
public class QuestionController {
    @Autowired
    private QuestionService questionService;

    @Autowired
    private UserService userService;

    /**
     * 新增问题
     * @param requestQuestionVo
     * @return
     */
   @PostMapping("insert")
    public Result insert(@RequestBody RequestQuestionVo requestQuestionVo){
       return Result.getSuccess().setData(questionService.insert(requestQuestionVo));
   }

    /**
     * 查询所有问题
     * @return
     */
   @GetMapping("queryAll/{houseSourceId}")
    public Result queryAll(@PathVariable Integer houseSourceId){
       return Result.getSuccess().setData(questionService.queryAll(houseSourceId));
   }


}
